package com.fairytask.ui.main
{
	import com.fairytask.ui.BuffUI;
	import com.fairytask.ui.CoolDownTimeUI;
	import com.fairytask.ui.LevelUpInfoUI;
	import com.fairytask.ui.PanelUI;
	import com.fairytask.ui.SysHintUI;
	import com.fairytask.ui.TaskTraceUI;
	import com.fairytask.ui.skillUnit.SkillUI;

	/**
	 * 主UI管理控制 
	 * @author xujh
	 * 
	 */
	public class MainUIManager
	{
		private static 	var _self			:MainUIManager;
		//场景类型
		public static const CITY		:int = 0;	//城市
		public static const WILD		:int = 1;	//野外
		public static const AREA		:int = 2;	//区域
		public static const ARENA		:int = 3;   //打开竞技场
		public static const BATTLE	:int = 99;	//战斗
		public static function getInstance():MainUIManager
		{
			if(_self == null)
			{
				_self = new MainUIManager();
			}
			return _self;
		}
		
		public function MainUIManager()
		{
			initLoadUI();
		}
		
		/**
		 * 初始化ui，用于编译到swf 
		 * 
		 */
		private function initLoadUI():void
		{
			PanelUI.getInstance();
			SkillUI.getInstance();
		}
		
		/**
		 * 设置显示的主UI 
		 * @param type 场景类型
		 * 
		 */
		public function showMainUI(type:int):void
		{
			switch(type)
			{
				case CITY:
					HeadUI.getInstance().show();
					FunBtnUI.getInstance().show();
					MainMapUI.getInstance().show();
					MainMapUI.getInstance().canMiniMap = true;
					ChatUI.getInstance().show();
					TaskTraceUI.getInstance().show();
					TopUI.getInstance().show();
					CoolDownTimeUI.getInstance().show();
					BuffUI.getInstance().show();
					LevelUpInfoUI.getInstance().show();
					SysHintUI.getInstance().show();
					break;
				case WILD:
				case AREA:
					HeadUI.getInstance().show();
					FunBtnUI.getInstance().show();
					MainMapUI.getInstance().show();
					ChatUI.getInstance().show();
					TaskTraceUI.getInstance().show();
					CoolDownTimeUI.getInstance().show();
					TopUI.getInstance().show();
					BuffUI.getInstance().show();
					LevelUpInfoUI.getInstance().show();
					SysHintUI.getInstance().show();
					break;
				case ARENA:
					HeadUI.getInstance().hide();
					FunBtnUI.getInstance().hide();
					MainMapUI.getInstance().hide();
					ChatUI.getInstance().hide();
					TaskTraceUI.getInstance().hide();
					CoolDownTimeUI.getInstance().hide();
					BuffUI.getInstance().hide();
					TopUI.getInstance().hide();
					LevelUpInfoUI.getInstance().hide();
					SysHintUI.getInstance().show();
					break;
				case BATTLE:
					HeadUI.getInstance().hide();
					FunBtnUI.getInstance().hide();
					MainMapUI.getInstance().hide();
					ChatUI.getInstance().show();
					TaskTraceUI.getInstance().hide();
					CoolDownTimeUI.getInstance().hide();
					BuffUI.getInstance().hide();
					TopUI.getInstance().hide();
					LevelUpInfoUI.getInstance().hide();
					SysHintUI.getInstance().hide();
					break;
			}
		}
	}
}